package cn.edu.jxau.dao.impl;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import cn.edu.jxau.common.User;
import cn.edu.jxau.dao.UserDao;
import cn.edu.jxau.utils.druip.TxQueryRunner;

public class UserDaoImpl implements UserDao{

	QueryRunner qr = new TxQueryRunner();

	@Override
	public User queryUser(User from) {
		try {
			String sql = "select * from user where userName=?";
			return qr.query(sql, new BeanHandler<User>(User.class), from.getUserName());
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
	
	
}
